import {TOKEN} from "@/constants/KEY";

export default {
  namespaced: true,

  state: {
    // token: getToken() || ''
    token: localStorage.getItem(TOKEN) ? localStorage.getItem(TOKEN) : '',
  },
  mutations: {
    setToken(state, NewToken) {
      state.token = NewToken
      // setToken(NewToken)
      localStorage.setItem(TOKEN, NewToken)
    },
    removeToken(state) {
      state.token = ''
      localStorage.removeItem('token')
    }
  },
  actions: {}
}
